package cash.cmp.personal_financial_system.service.impl;

import cash.cmp.personal_financial_system.mapper.SysMsgMapper;
import cash.cmp.personal_financial_system.model.SysMsg;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class SysMsgServiceImpl {

    @Autowired
    public SysMsgMapper msgMapper;

    public List<SysMsg> findMsgById(Integer objectId){
        List<SysMsg> sysMsgs = msgMapper.findMsgById(objectId);
        return sysMsgs;
    }

    public SysMsg findMsgByMsgId(String MsgId){
        SysMsg sysMsg = msgMapper.findMsgByMsgId(MsgId);
        return sysMsg;
    }

    //删除用户角色对应
    public Boolean deleteMsgById(Integer msgId){
        return msgMapper.deleteMsgById(msgId);
    }

    //插入一条信息
    public Boolean insertMsg(SysMsg sysMsg){
        return msgMapper.insertMsg(sysMsg);
    }

    public Boolean updateMsg(String msgId ,Integer type, Integer readState){
        return msgMapper.updateMsg(msgId, type, readState);
    }

}
